$(function() {
	load_baseServiceCost_select();
	load_baseServiceCost_cond_select();
	
	_addChangeListener("#baseServiceCost_select", function() {
		var option = $('#baseServiceCost_select option:selected');
		if(view && view.data) {view.data.serviceName = option.text();}
	});
});

function load_baseServiceCost_select() {
	if($('#baseServiceCost_select').length==0) {return;}

	$('#baseServiceCost_select').html('<option value="" selected></option>');

	findAll_basic(path+'/baseServiceCost/findAll', function(response) {
		for(var i=0; i<response.data.length; i++) {
			$('#baseServiceCost_select').append('<option value="' + response.data[i].baseServiceCostId
				+ '">' + response.data[i].serviceName + ' ' + response.data[i].price + '元/月 '
				+ response.data[i].deductionWay + '</option>');
		}
	});
}

function load_baseServiceCost_cond_select() {
	if($('#baseServiceCost_cond_select').length==0) {return;}

	$('#baseServiceCost_cond_select').html('<option value="" selected></option>');

	findAll_basic(path+'/baseServiceCost/findAll', function(response) {
		for(var i=0; i<response.data.length; i++) {
			$('#baseServiceCost_cond_select').append('<option value="' + response.data[i].baseServiceCostId
				+ '">' + response.data[i].serviceName + ' ' + response.data[i].price + '元/月 '
				+ response.data[i].deductionWay + '</option>');
		}
	});
}
